<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body th:fragment="menu">
<aside class="main-sidebar">
    <section class="sidebar">
        <div class="user-panel">
            <div class="pull-left image">
                <img th:src="@{{adminlte}/dist/img/user2-160x160.jpg(adminlte=${adminlte})}" class="img-circle"
                     alt="User Image">
            </div>
            <div class="pull-left info">
                <p th:text="${admin.userName}"></p>
                <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
            </div>
        </div>

        <ul class="sidebar-menu" data-widget="tree">
            <li class="header">功能菜单</li>
            <li class="active treeview">
                <a href="#">
                    <i class="fa fa-book"></i> <span>管理员管理</span>
                    <span class="pull-right-container">
                      <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="javascript:void(0);" id="btnAdminIndex" onclick="show(this.id)"><i class="fa fa-circle-o"></i> 管理员列表</a></li>
                    <li><a href="javascript:void(0);" id="btnAdminForm" onclick="show(this.id);"><i class="fa fa-circle-o"></i> 新增管理员</a></li>
                </ul>
            </li>
        </ul>
    </section>
</aside>

<script>
    function show(id) {
        var iFrame = document.getElementById("iFrame");

        if (id === "btnAdminIndex") {
            iFrame.src = "/index";
        }

        else if (id == "btnAdminForm") {
            iFrame.src = "/form";
        }
    }
</script>
</body>
</html>